' Rename
' This program lets you rename a data file on disk.

CLS

PRINT "This program renames a file on disk."
INPUT "Press Return and find the file you want to rename", dummy$

oldName$ = FILES$(1, "TEXT")                            ' get old filename
newName$ = FILES$(0, "Enter new filename")    ' get new filename

NAME oldName$ AS newName$  ' try to rename file

' If oldName$ does not exist or newName$ is an invalid name, the
'   NAME statement will generate a run-time error message; otherwise,
'   the following lines will be executed:

PRINT                      ' print success message
INPUT "File renamed successfully; press Return to continue", dummy$
